package com.dreammakerteam.frameworkdemo.base.service.impl;

import com.dreammakerteam.frameworkdemo.base.domain.DUserDo;
import com.dreammakerteam.frameworkdemo.base.mapper.DUserMapper;
import com.dreammakerteam.frameworkdemo.base.service.DUserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 用户服务
 * @author xy
 * @version 0.1
 */
@Service
public class DUserServiceImpl extends DBaseServiceImpl implements DUserService {

    @Resource
    private DUserMapper dUserMapper;

    @Override
    public DUserDo getByUsernameAndPassword(String username, String password) {
        return dUserMapper.selectOne(new DUserDo().setDuUsername(username).setDuPassword(enCodingPassword(password)));
    }

    @Override
    public String enCodingPassword(String password) {
        return password;
    }

    @Override
    public DUserMapper getMapper() {
        return dUserMapper;
    }
}
